<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link th:href="@{../assets/css/page.css}" rel="stylesheet"/>
    <link th:href="@{../assets/libs/nice-validator/dist/jquery.validator.css}" rel="stylesheet"/>
    <link th:href="@{../assets/libs/selectpage/selectpage.base.css}" rel="stylesheet"/>
    <script type="text/javascript" th:src="@{../assets/libs/jquery/dist/jquery.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/jquery.validator.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/nice-validator/dist/local/zh-CN.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/login/jquery.md5.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/login/jquery.tips.js}"></script>
    <script type="text/javascript" th:src="@{../assets/js/page.js}"></script>
    <script type="text/javascript" th:src="@{../assets/libs/selectpage/selectpage.js}"></script>
    <!--[if lt IE 9]>
    <script th:src="@{../assets/js/html5shiv.js}"></script>
    <script th:src="@{../assets/js/respond.min.js}"></script>
    <![endif]-->
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: '../article/findItems',
                type: "get",
                dataType: "json",
                success: function (result) {
                    var html = "";
                    $.each(result, function (i, item) {
                        html += "<option value=" + item.iid + ">" + item.ctitle + "</option>";
                    })
                    $("#ilinkid").html(html);
                },
                error: function (error) {

                }
            })
            /*var data = [];
            $.ajax({//初始默认加载
                url: "../video/findItems",
                type: "get",
                dataType: "json",
                async:false,
                success: function (result) {


                    $.each(result, function (i, item) {
                        data.push({id:item.iid ,name:item.ctitle,desc:item.cdesc});
                    });
                },
                error: function (error) {

                }
            });
            //init SelectPage
            $('#ilinkid').selectPage({
                showField : 'name',
                keyField : 'id',
                data : data,
                pageSize:10
            });
            $("#clinktype").change(function () {
                //置空
                data = [];
                var curl = "";
                var value = $("#clinktype option:selected").val();
                if(value == "0"){
                    curl = "../video/findItems";
                } else{
                    curl = "../article/findItems";
                }
                $.ajax({
                    url: curl,
                    type: "get",
                    dataType: "json",
                    success: function (result) {

                        $.each(result, function (i, item) {
                            data.push({id:item.iid ,name:item.ctitle,desc:item.cdesc});
                        });
                        data = data;
                        //init SelectPage
                        $('#ilinkid').selectPageData(data);
                    },
                    error: function (error) {

                    }
                })
            });*/


            /*$("#cicon").change(function () {
                var cicon = $("#cicon option:selected").text();
                $("#ciconsub").val(cicon);
            })*/
        })
    </script>
</head>
<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="./addItem" autocomplete="off">
                            <!--<input id="iid" name="iid" type="hidden"/>-->
                            <div class="form-group">
                                <label for="ctitle" class="control-label col-xs-12 col-sm-2">消息标题:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="ctitle" name="ctitle" value="" data-rule="消息标题:required" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cbody" class="control-label col-xs-12 col-sm-2">消息内容:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="cbody" name="cbody" value="" data-rule="消息内容:required" />
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label for="clinktype" class="control-label col-xs-12 col-sm-2">链接类型:</label>
                                <div class="col-xs-12 col-sm-8">
                                    &lt;!&ndash;<input type="text" class="form-control" id="clinktype" name="clinktype" value="" data-rule="required" />&ndash;&gt;
                                    <select name="clinktype" id="clinktype" class="form-control">
                                        <option value="0">视频</option>
                                        <option value="1">图文</option>
                                    </select>
                                </div>
                            </div>-->
                            <div class="form-group">
                                <label for="ilinkid" class="control-label col-xs-12 col-sm-2">链接标题:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select name="ilinkid" id="ilinkid" class="form-control">

                                    </select>
                                    <!--<input type="text" id="ilinkid" name="ilinkid" class="form-control" value="0"/>&lt;!&ndash; data-rule="链接标题:required"&ndash;&gt;-->
                                    <!--<input type="text" class="form-control" id="ilinkid" name="ilinkid" value="" data-rule="链接id:required" />-->
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="cdevicetype" class="control-label col-xs-12 col-sm-2">发送设备类型:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <!--<input type="text" class="form-control" id="cdevicetype" name="cdevicetype" value="" data-rule="required" />-->
                                    <select name="cdevicetype" id="cdevicetype" class="form-control">
                                        <option value="ANDROID">ANDROID</option>
                                        <option value="iOS">IOS</option>
                                        <option value="ALL">ALL</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="ctype" class="control-label col-xs-12 col-sm-2">消息类型:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <!--<input type="text" class="form-control" id="ctype" name="ctype" value="" data-rule="required" />-->
                                    <select name="ctype" id="ctype" class="form-control">
                                        <option value="NOTICE">通知</option>
                                        <option value="MESSAGE">消息</option>
                                    </select>
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label for="irequestid" class="control-label col-xs-12 col-sm-2">请求ID:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="irequestid" name="irequestid" value="" data-rule="required" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="imessageid" class="control-label col-xs-12 col-sm-2">消息ID:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="imessageid" name="imessageid" value="" data-rule="required" />
                                </div>
                            </div>-->
                            <div class="form-group">
                                <label for="ccomment" class="control-label col-xs-12 col-sm-2">备注:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="ccomment" name="ccomment" value=""/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8 text-center">
                                    <button type="submit" class="btn btn-success btn-embossed">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap/dist/js/bootstrap.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/toastr/toastr.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/layer/src/layer.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js}"></script>
<script type="text/javascript" th:src="@{../assets/libs/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
</body>
</html>

